package com.example.aacwebdemo.es.core.bean;

/**
 * @author zhao.xin06679
 * @date 2021年06月22日 17:34
 */
public class ESPageRequest {

    private final int pageNo;
    private final int size;

    public ESPageRequest(int pageNo, int size) {

        if (pageNo < 0) {
            throw new IllegalArgumentException("Page index must not be less than zero!");
        }

        if (size < 1) {
            throw new IllegalArgumentException("Page size must not be less than one!");
        }

        this.pageNo = pageNo;
        this.size = size;
    }

    public int getPageNo() {
        return pageNo;
    }

    public int getSize() {
        return size;
    }
}
